"""
@Project ：TeachingInterfacePro 
@File    ：UploadFile.py
@IDE     ：PyCharm 
@Author  ：ceiling
@Date    ：2025/4/19 11:33 
"""
import requests


class UploadFile:

    def __init__(self):
        self.url = "http://www.httpbin.org/post"
        self.headers = {
            "Accept": "application/json",
        }

    def upload_file(self, file):

        file = [
            ("file", open(file, "rb")),
        ]

        response = requests.post(self.url, self.headers, files=file)
        return response
